<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>ToolTip</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>
<body>

<h1>ToolTip</h1>

<p>Creates an always-on-top window anywhere on the screen.</p>

<pre class="Syntax">ToolTip [, Text, X, Y, WhichToolTip]</pre>
<h3>Parameters</h3>
<dl>

  <dt>Text</dt>
  <dd><p>If blank or omitted, the existing tooltip (if any) will be hidden. Otherwise, this parameter is the text to display in the tooltip. To create a multi-line tooltip, use the linefeed character (`n) in between each line, e.g. Line1`nLine2.</p>
      <p>If <em>Text</em> is long, it can be broken up into several shorter lines by means of a <a href="../Scripts.htm#continuation">continuation section</a>, which might improve readability and maintainability.</p></dd>

  <dt>X, Y</dt>
  <dd><p>The X and Y position of the tooltip relative to the active window (use <code><a href="CoordMode.htm">CoordMode</a>, ToolTip</code> to change to screen coordinates). If the coordinates are omitted, the tooltip will be shown near the mouse cursor. X and Y can be <a href="../Variables.htm#Expressions">expressions</a>.</p></dd>

  <dt>WhichToolTip</dt>
  <dd><p>Omit this parameter if you don't need multiple tooltips to appear simultaneously. Otherwise, this is a number between 1 and 20 to indicate which tooltip window to operate upon. If unspecified, that number is 1 (the first). This parameter can be an <a href="../Variables.htm#Expressions">expression</a>.</p></dd>

</dl>
<h3>Remarks</h3>
<p>If the X &amp; Y coordinates would cause the tooltip to run off screen, it is repositioned to be entirely visible.</p>
<p>The tooltip is displayed until one of the following occurs:</p>
<ul>
  <li>The script terminates.</li>
  <li>The ToolTip command is executed again with a blank <em>Text</em> parameter.</li>
  <li>The user clicks on the tooltip (this behavior may vary depending on operating system version).</li>
</ul>
<p>A GUI window may be made the owner of a tooltip by means of <a href="Gui.htm#OwnDialogs">Gui +OwnDialogs</a>. Such a tooltip is automatically destroyed when its owner is destroyed.</p>
<h3>Related</h3>
<p><a href="CoordMode.htm">CoordMode</a>, <a href="TrayTip.htm">TrayTip</a>, <a href="Gui.htm">GUI</a>, <a href="Progress.htm">Progress</a>, <a href="SplashTextOn.htm">SplashTextOn</a>, <a href="MsgBox.htm">MsgBox</a>, <a href="InputBox.htm">InputBox</a>, <a href="FileSelectFile.htm">FileSelectFile</a>, <a href="FileSelectFolder.htm">FileSelectFolder</a></p>
<h3>Example</h3>
<pre class="NoIndent">ToolTip, Multiline`nTooltip, 100, 150

<em>; To have a ToolTip disappear after a certain amount of time
; without having to use Sleep (which stops the current thread):</em>
#Persistent
ToolTip, Timed ToolTip`nThis will be displayed for 5 seconds.
SetTimer, RemoveToolTip, 5000
return

RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return</pre>

</body>
</html>
